#define _CRT_SECURE_NO_WARNINGS 1
#include "string.h"

namespace wusaqi
{
	void test01()
	{
		string s1;
		cout << s1.c_str() << endl;
		string s2("abcdef");
		cout << s2.c_str() << endl;
		for (int i = 0; i < s2.size(); i++)
		{
			s2[i]++;
		}
		cout << s2.c_str() << endl;

		for (auto& e : s2)
		{
			cout << e << " ";
		}
		cout << endl;

		string::iterator it1 = s2.begin();
		while (it1 != s2.end())
		{
			cout << (*it1) << " ";
			it1++;
		}
	}

	void test02()
	{
		string s1("good morning");
 		s1.push_back('f');
		cout << s1.c_str() << endl;
		s1.append(" wusaqi");
		cout << s1.c_str() << endl;
		s1 += "666888";
		cout << s1.c_str() << endl;
		s1 += 'x';
		cout << s1.c_str() << endl;
		s1 += '\0';
		s1 += '\0';
		s1 += 'f';
		cout << s1.c_str() << endl;
		cout << s1 << endl;
		s1 += " yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
		cout << s1 << endl;
	}

	void test03()
	{
		string s1("good morn");
		s1.append("abc");
		s1.append("abcdef");
		cout << s1 << endl;
		//cout << s1 << endl;
		//s1.insert(5, 'x');
		//cout << s1 << endl;
		//s1.insert(5, "xyzouc");
		//cout << s1 << endl;
	}
}


int main()
{
	//wusaqi::test01();
	//wusaqi::test02();
	wusaqi::test03();
	return 0;
}